/**
 * 消息相关API类型定义
 */

export interface Message {
  id: string;
  consultId: string;
  senderId: string;
  senderType: 'user' | 'doctor' | 'system';
  type: 'text' | 'image' | 'voice' | 'video' | 'file';
  content: string;
  metadata?: {
    fileName?: string;
    fileSize?: number;
    duration?: number;
    thumbnail?: string;
  };
  status: 'sending' | 'sent' | 'delivered' | 'read' | 'failed';
  createdAt: string;
  updatedAt: string;
}

export interface SendMessageParams {
  consultId: string;
  type: 'text' | 'image' | 'voice' | 'video' | 'file';
  content: string;
  metadata?: {
    fileName?: string;
    fileSize?: number;
    duration?: number;
    thumbnail?: string;
  };
}

export interface MessageListQuery {
  consultId: string;
  page?: number;
  pageSize?: number;
  type?: 'text' | 'image' | 'voice' | 'video' | 'file';
  startDate?: string;
  endDate?: string;
}

export interface MessageListResponse {
  list: Message[];
  total: number;
  page: number;
  pageSize: number;
}

export interface UnreadCount {
  consultId: string;
  count: number;
}

export interface MessageStats {
  totalMessages: number;
  unreadCount: number;
  todayMessages: number;
}

export interface MarkReadParams {
  messageIds: string[];
}
